﻿<%@ Page Title="" Language="vb" AutoEventWireup="false" MasterPageFile="~/Site.Master" CodeBehind="INGRESOCLIENTES.aspx.vb" Inherits="IMSS.SA.Formulario_web1" %>
<asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" runat="server">
    <style type="text/css">
        .style2
        {
        }
        .style3
        {
            text-align: center;
        }
        .style4
        {
            width: 445px;
            text-align: center;
        }
        .style6
        {
            width: 513px;
        }
        .style7
        {
            text-align: center;
            width: 1303px;
        }
        .style8
        {
            width: 1303px;
        }
        .style9
        {
            width: 513px;
            text-align: center;
        }
    </style>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
    <table style="width: 100%; background-color: #006699; color: #FFFFFF; background-image: url('../Styles/r3.PNG'); background-repeat: no-repeat;">
        <tr>
            <td class="style7">
                &nbsp;</td>
            <td class="style3" colspan="2">
                &nbsp;</td>
        </tr>
        <tr>
            <td class="style7">
                &nbsp;</td>
            <td class="style3" colspan="2">
                <asp:Label ID="Label1" runat="server" Text="Label" Visible="False"></asp:Label>
            </td>
        </tr>
        <tr>
            <td class="style7">
                &nbsp;</td>
            <td class="style3" colspan="2">
                &nbsp;</td>
        </tr>
        <tr>
            <td class="style7">
                &nbsp;</td>
            <td class="style3" colspan="2">
                INGRESO DE DATOS DE CLIENTES</td>
        </tr>
        <tr>
            <td class="style7">
                &nbsp;</td>
            <td class="style9">
                &nbsp;</td>
            <td class="style3">
                &nbsp;</td>
        </tr>
        <tr>
            <td class="style7">
                &nbsp;</td>
            <td class="style9">
                NUM_CEDULA</td>
            <td class="style3">
                <asp:TextBox ID="TexCEDULA" runat="server" MaxLength="20"></asp:TextBox>
            </td>
        </tr>
        <tr>
            <td class="style7">
                &nbsp;</td>
            <td class="style9">
                NOMBRE</td>
            <td class="style3">
                <asp:TextBox ID="TexNOMBRE" runat="server" MaxLength="15"></asp:TextBox>
            </td>
        </tr>
        <tr>
            <td class="style7">
                &nbsp;</td>
            <td class="style9">
                DIRECCION</td>
            <td class="style3">
                <asp:TextBox ID="TexDIRECCION" runat="server" MaxLength="15"></asp:TextBox>
            </td>
        </tr>
        <tr>
            <td class="style7">
                &nbsp;</td>
            <td class="style9">
                TELEFONO</td>
            <td class="style3">
                <asp:TextBox ID="TexTELEFONO" runat="server" MaxLength="15"></asp:TextBox>
            </td>
        </tr>
        <tr>
            <td class="style7">
                &nbsp;</td>
            <td class="style9">
                EMAIL</td>
            <td class="style3">
                <asp:TextBox ID="TexEMAIL" runat="server" MaxLength="30"></asp:TextBox>
            </td>
        </tr>
        <tr>
            <td class="style7">
                &nbsp;</td>
            <td class="style9">
                CIUDAD</td>
            <td class="style3">
                <asp:TextBox ID="TexCIUDAD" runat="server" MaxLength="20"></asp:TextBox>
            </td>
        </tr>
        <tr>
            <td class="style7">
                &nbsp;</td>
            <td class="style9">
                &nbsp;</td>
            <td class="style3">
                &nbsp;</td>
        </tr>
        <tr>
            <td class="style7">
                &nbsp;</td>
            <td class="style9">
                <asp:Button ID="ENVIAR" runat="server" Text="ENVIAR" />
            </td>
            <td class="style3">
                <asp:Button ID="BORRAR" runat="server" Text="BORRAR" />
            </td>
        </tr>
        <tr>
            <td class="style7">
                &nbsp;</td>
            <td class="style9">
                &nbsp;</td>
            <td class="style4">
                &nbsp;</td>
        </tr>
        <tr>
            <td class="style8">
                &nbsp;</td>
            <td class="style2" colspan="2">
                <asp:GridView ID="GridView1" runat="server" DataSourceID="SqlDataSource1" 
                    AutoGenerateColumns="False" DataKeyNames="Num_Cedula" Width="775px" 
                    BackColor="White" BorderColor="#CCCCCC" BorderStyle="None" BorderWidth="1px" 
                    CellPadding="3">
                    <Columns>
                        <asp:BoundField DataField="Num_Cedula" HeaderText="Num_Cedula" ReadOnly="True" 
                            SortExpression="Num_Cedula" />
                        <asp:BoundField DataField="Nombre" HeaderText="Nombre" 
                            SortExpression="Nombre" />
                        <asp:BoundField DataField="Direccion" HeaderText="Direccion" 
                            SortExpression="Direccion" />
                        <asp:BoundField DataField="Telefono" HeaderText="Telefono" 
                            SortExpression="Telefono" />
                        <asp:BoundField DataField="Email" HeaderText="Email" SortExpression="Email" />
                        <asp:BoundField DataField="ciudad" HeaderText="ciudad" 
                            SortExpression="ciudad" />
                    </Columns>
                    <FooterStyle BackColor="White" ForeColor="#000066" />
                    <HeaderStyle BackColor="#006699" Font-Bold="True" ForeColor="White" />
                    <PagerStyle BackColor="White" ForeColor="#000066" HorizontalAlign="Left" />
                    <RowStyle ForeColor="#000066" />
                    <SelectedRowStyle BackColor="#669999" Font-Bold="True" ForeColor="White" />
                    <SortedAscendingCellStyle BackColor="#F1F1F1" />
                    <SortedAscendingHeaderStyle BackColor="#007DBB" />
                    <SortedDescendingCellStyle BackColor="#CAC9C9" />
                    <SortedDescendingHeaderStyle BackColor="#00547E" />
                </asp:GridView>
                <asp:SqlDataSource ID="SqlDataSource1" runat="server" 
                    ConnectionString="<%$ ConnectionStrings:IMSS.SAConnectionString15 %>" 
                    DeleteCommand="DELETE FROM [CLIENTE] WHERE [Num_Cedula] = @Num_Cedula" 
                    InsertCommand="INSERT INTO [CLIENTE] ([Num_Cedula], [Nombre], [Direccion], [Telefono], [Email], [ciudad]) VALUES (@Num_Cedula, @Nombre, @Direccion, @Telefono, @Email, @ciudad)" 
                    SelectCommand="SELECT [Num_Cedula], [Nombre], [Direccion], [Telefono], [Email], [ciudad] FROM [CLIENTE]" 
                    UpdateCommand="UPDATE [CLIENTE] SET [Nombre] = @Nombre, [Direccion] = @Direccion, [Telefono] = @Telefono, [Email] = @Email, [ciudad] = @ciudad WHERE [Num_Cedula] = @Num_Cedula">
                    <DeleteParameters>
                        <asp:Parameter Name="Num_Cedula" Type="String" />
                    </DeleteParameters>
                    <InsertParameters>
                        <asp:ControlParameter ControlID="TexCEDULA" Name="Num_Cedula" 
                            PropertyName="Text" Type="String" />
                        <asp:ControlParameter ControlID="TexNOMBRE" Name="Nombre" PropertyName="Text" 
                            Type="String" />
                        <asp:ControlParameter ControlID="TexDIRECCION" Name="Direccion" 
                            PropertyName="Text" Type="String" />
                        <asp:ControlParameter ControlID="TexTELEFONO" Name="Telefono" 
                            PropertyName="Text" Type="String" />
                        <asp:ControlParameter ControlID="TexEMAIL" Name="Email" PropertyName="Text" 
                            Type="String" />
                        <asp:ControlParameter ControlID="TexCIUDAD" Name="ciudad" PropertyName="Text" 
                            Type="String" />
                    </InsertParameters>
                    <UpdateParameters>
                        <asp:Parameter Name="Nombre" Type="String" />
                        <asp:Parameter Name="Direccion" Type="String" />
                        <asp:Parameter Name="Telefono" Type="String" />
                        <asp:Parameter Name="Email" Type="String" />
                        <asp:Parameter Name="ciudad" Type="String" />
                        <asp:Parameter Name="Num_Cedula" Type="String" />
                    </UpdateParameters>
                </asp:SqlDataSource>
            </td>
        </tr>
        <tr>
            <td class="style8">
                &nbsp;</td>
            <td class="style6">
                &nbsp;</td>
            <td class="style2">
                &nbsp;</td>
        </tr>
    </table>
</asp:Content>
